package com.example.shoppingmall.service;

import com.example.shoppingmall.dao.PayMethodMapper;
import com.example.shoppingmall.pojo.MetState;
import com.example.shoppingmall.pojo.PayMethod;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PayMethodService {

    @Autowired
    PayMethodMapper payMethodMapper;

    //多条件查询+分页
    public List<PayMethod> getMethod(String method_name, Integer method_state,
                                     Integer pageNo, Integer pageNum){
        return payMethodMapper.getMethod(method_name,method_state,pageNo,pageNum);
    }

    //总条数
    public int total(String method_name,Integer method_state){
        return payMethodMapper.total(method_name,method_state);
    }

    //明细
    public PayMethod getMet(Integer method_id){
        return payMethodMapper.getMet(method_id);
    }

    //修改
    public int updateMet(PayMethod payMethod){
        return payMethodMapper.updateMet(payMethod);
    }

    //修改
    public int updateMet2(PayMethod payMethod){
        return payMethodMapper.updateMet2(payMethod);
    }

    //状态List
    public List<MetState> staList(){
        return payMethodMapper.staList();
    }

    //查询支付名称
    public List<PayMethod> metList(){
        return payMethodMapper.metList();
    }

}
